<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.css" />
<link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.min.css" />
<script type="text/javascript" src="/static/h-ui/js/jquery-3.6.0.min.js"></script>
<title>timo列表</title>
</head>
<style type="text/css">
.ui-sortable .panel-header{ cursor:move}

.pagination {}

.pagination li {display: inline-block;margin-right: -1px;padding: 5px;border: 1px solid #e2e2e2;min-width: 20px;text-align: center;}

.pagination li.active {background: #009688;color: #fff;border: 1px solid #009688;}

.pagination li a {display: block;text-align: center;}
.top{
	width: 1800px;
}
.option{
  /*用div的样式代替select的样式*/
    margin: 1px;
   width: 140px;
    height: 40px;
	float: left;
    /*border-radius: 5px;*/
  /*盒子阴影修饰作用,自己随意*/
 /* box-shadow: 0 0 5px #ccc;*/

    position: relative;
  }
  .option select{
  /*清除select的边框样式*/

  /*清除select聚焦时候的边框颜色*/

  /*将select的宽高等于div的宽高*/
  width: 100%;
    height: 40px;
    line-height: 40px;
  /*隐藏select的下拉图标*/
  appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  /*通过padding-left的值让文字居中*/
  padding-left: 20px;
  }

.t2{
	float:left;
	margin-left:30px;
}
.search{
	float:left;
	margin-left:100px;
	text-align:center
    }
</style>
<body>


<div class="panel panel-default mt-20">
	
				<div class="panel-body">
					<form action="/video" method="get" id="searchForm">
						<div class="top" >
							<div class="option">
					        	<select name="type" id="type">
					          		<option value="">筛选分类</option>
					          		{volist name='cat_list' id='cat'}
					          			<option {eq name="type" value="$cat.type_id"} selected{/eq} value="{$cat.type_id}">{$cat.type_name}</option>
					          		{/volist}
					        	</select>
					        	
				     		</div>
				     		<div id="type2_html" class="option">
				     			{eq name="is_sub_cat" value="1"}
				     				<select name="type2" >
				     					{volist name='sub_cat' id='cat2'}
					          				<option {eq name="type2" value="$cat2.type_id"} selected{/eq} value="{$cat2.type_id}">{$cat2.type_name}</option>
					          			{/volist}
				     				</select>
				     			{/eq}
				     		</div>
				     		<div  class="search">名字:  <input type="text" name="name" width=100 value="{$name}"/>
				        		<input type="button" class="btn btn-primary radius" id="submitbut" value="搜索">
				        	</div>
				        	<div style="float:right"><input type="button" class="btn btn-primary radius" id="add_btn" value="新增信息"></div>
				     	</div>
			     	</form>
					<table class="table table-border table-bordered table-striped mt-20">
				
						<thead>
							<tr>
								<th class="col1">名字</th>
								<th class="col2">分类</th>
								<th class="col3">操作</th>
							</tr>
						</thead>
						<tbody>
						{volist name='list' id='content'}
							<tr>
								<th class="col1">{$content.name}</th>
								<td class="col2">{$content.type_cn}</td>
								<td class="col3"><a target="_blank" href="/edit?a_id={$content.a_id}">查看</a></td>
							</tr>
						{/volist}

						</tbody>
					</table>
				</div>
				
			</div>
			{$page}
</body>
<script type="text/javascript">
$("#submitbut").click(function(){
	
	$("#searchForm").submit();
});
		
$("#add_btn").click(function(){
	window.open("/add");
	
});
		
		
$("#type").change(function(){ 
	$("#type2_html").html("");
	 var type_id =this.value;
	       


	 $.post("/changetype",{"type_id":type_id},function(res){
		 var dataObj=eval("("+res+")");
		 var html="<select name='type2'><option value=''>请选择</option>";
		 $.each(dataObj,function(idx,item){
				
			 html+="<option value='"+item.type_id+"'>"+item.type_name+"</option>";
			 	
			 });
			html+="</select>";
			$("#type2_html").html(html);
	  });
	       
	 });
</script>

</html>